Skip to content

Conversation

smuppand
Copy link
Contributor

  • Always wait a fixed PRE_STOP_DELAY (default 30s) before stopping ADSP.
  • Take a quick audio runtime-PM snapshot before the delay; optionally gate the stop after the delay with FATAL_ON_UNSUSPENDED=1:
    • If enabled and the stack is not suspended/unsupported after the fixed delay, abort the test before issuing the stop.
  • Print effective tunables at startup for clarity.
  • Retain dynamic audio driver discovery (no hardcoding), single module status log, and whole-stack PM checks (platform sound, ALSA cards, SoundWire). Accept 'suspended' or 'unsupported' as OK.
  • Preserve remoteproc stop/start sequencing, transition logs, and optional RPMsg ping.

Tunables (env)

  • PRE_STOP_DELAY : seconds to wait before stop (default: 30)
  • FATAL_ON_UNSUSPENDED : 1 to abort if PM not OK after delay (default: 0)
  • STOP_TO / START_TO / POLL_I remain unchanged.

Examples

  • Always wait 30s, abort if audio not suspended/unsupported afterwards FATAL_ON_UNSUSPENDED=1 ./run.sh
  • Use a longer fixed delay
    PRE_STOP_DELAY=45 ./run.sh

* Always wait a fixed PRE_STOP_DELAY (default 30s) before stopping ADSP.
* Take a quick audio runtime-PM snapshot before the delay; optionally
  gate the stop after the delay with FATAL_ON_UNSUSPENDED=1:
  - If enabled and the stack is not suspended/unsupported after the
    fixed delay, abort the test before issuing the stop.
* Print effective tunables at startup for clarity.
* Retain dynamic audio driver discovery (no hardcoding), single module
  status log, and whole-stack PM checks (platform sound, ALSA cards,
  SoundWire). Accept 'suspended' or 'unsupported' as OK.
* Preserve remoteproc stop/start sequencing, transition logs, and
  optional RPMsg ping.

Tunables (env)
--------------
* PRE_STOP_DELAY   : seconds to wait before stop (default: 30)
* FATAL_ON_UNSUSPENDED : 1 to abort if PM not OK after delay (default: 0)
* STOP_TO / START_TO / POLL_I remain unchanged.

Examples
--------
# Always wait 30s; abort if audio not suspended/unsupported afterwards
FATAL_ON_UNSUSPENDED=1 ./run.sh

# Use a longer fixed delay
PRE_STOP_DELAY=45 ./run.sh

Signed-off-by: Srikanth Muppandam <[email protected]>
@smuppand smuppand requested a review from vnarapar August 21, 2025 18:39
CHECK_NODES=""
if [ -z "$platform_drv" ]; then
log_warn "No suitable platform audio driver found (module+bound); skipping suspend snapshot"
AUDIO_PM_SNAPSHOT_OK=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we append skip to result here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we append skip to result here

AFAIK, we cannot skip the test because the driver does not have the capability to display the PM stats, as it shows unsupported. The message reads: Audio PM snapshot: OK (suspended/unsupported). Based on this, we are able to skip the entire test.

log_info "DEBUG: STOP_TO=$STOP_TO START_TO=$START_TO POLL_I=$POLL_I"
if [ -z "$CHECK_NODES" ]; then
log_warn "No runtime_status nodes found for audio stack; treating snapshot as OK"
AUDIO_PM_SNAPSHOT_OK=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u add skip so that it will show in the result

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can u add skip so that it will show in the result

It's the same here. We can't add SKIP, so instead we're using log_info for debugging purposes.

log_info "Dumping ${base} [${label}] → ${logfile}"
[ -r "$rpath/trace" ] && cat "$rpath/trace" >"$logfile"
dmesg --ctime | grep -i "$base" >>"$logfile" 2>/dev/null || :
dmesg | grep -i "$base" >>"$logfile" 2>/dev/null || :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why --ctime is removed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why --ctime is removed here

The current dmesg utility does not include this option, so it will display a usage error.

@smuppand smuppand requested a review from vnarapar August 22, 2025 07:24
Copy link
Contributor

@vnarapar vnarapar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vnarapar vnarapar merged commit f91f6d5 into qualcomm-linux:main Aug 22, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants